package top.revery.datasource.service;

import org.springframework.web.bind.annotation.RestController;
import top.revery.api.api.category.IHotKeyword;
import top.revery.api.entity.other.BaseHotKeyword;
import top.revery.datasource.util.dsource;

import java.util.List;

/**
 * <h1> --- web单页面 --- </h1>
 * Created by  revery.top jun
 * Date  2020年01月16日
 */
@RestController
public class HotKeyWordServiceController implements IHotKeyword {

    @Override
    public List<BaseHotKeyword> getList() {
        return dsource.hotKeyWordDto.findAll();
    }

    @Override
    public BaseHotKeyword save(BaseHotKeyword hotKeyword) {

        BaseHotKeyword baseHotKeyword = dsource.hotKeyWordDto.save(hotKeyword);

        return baseHotKeyword;
    }

    @Override
    public Boolean del(Long id) {
        dsource.hotKeyWordDto.deleteById(id);
        return true;
    }
}
